/*
自己选择的路 ,跪着也要走完。朋友们 , 虽然这个世界日益浮躁起来,只
要能够为了当时纯粹的梦想和感动坚持努力下去 , 不管其它人怎么样,我
们也能够保持自己的本色走下去。
To the world , you will be a person , but to a person , you
will be the world .                               ——AKPower
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;

int a[maxn],pre[maxn];

int main()
{
    IOS;
    int t;
    cin >> t;

    while(t--){
        int n, m, k;
        cin >> n >> m >> k;
        pre[0] = 0;
        for (int i = 1; i <= n;i++){
            cin >> a[i];
            pre[i] = pre[i - 1] + a[i];
        }
            

        ll ans = a[1];
        for (int i = 2; i <= n&&i<=1+m;i++){
            ll now = pre[i];
            int left = m - i + 1;
            if(left>2*k){
                now += k * (a[i] + a[i - 1]) + pre[i + left - 2 * k] - pre[i];
            }
            else if(left<2*k){
                now += left / 2 * (a[i] + a[i - 1]) + (left % 2) * a[i-1];
            }
            else now += k * (a[i] + a[i - 1]);
            ans = max(ans, now);
        }
        cout << ans << endl;
    }
    getchar();
    getchar();
    return 0;
}
/*
1
5 3 0
1 5 4 3 2

*/